using System.Collections.Generic;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Providers;
using System.Data.SqlClient;
using System.Linq;

namespace OpenScrum.db.Migrations
{
    public class Settings : DbMigrationContext<OpenScrumDataContext>
    {
        public Settings()
        {
            AutomaticMigrationsEnabled = true;
            SetCodeGenerator<CSharpMigrationCodeGenerator>();
            AddSqlGenerator<SqlConnection, SqlServerMigrationSqlGenerator>();                        
        }

        protected override void Seed(OpenScrumDataContext context)
        {
            //context.Database.ExecuteSqlCommand("ALTER TABLE Project ADD CONSTRAINT uc_Project_Name UNIQUE(Name)");

            // add enumeration values here
            context.Swimlanes.Add(new Swimlane() {Name = "Pending"});
            context.Swimlanes.Add(new Swimlane() { Name = "In Progress" });
            context.Swimlanes.Add(new Swimlane() { Name = "Awaiting Publish" });
            context.Swimlanes.Add(new Swimlane() { Name = "Testing" });
            context.Swimlanes.Add(new Swimlane() { Name = "Accepted" });
        }
    }
}
